class AISuggestion {
  constructor(id, bill_id, suggested_category, confidence, explanation, created_at) {
    this.id = id;
    this.bill_id = bill_id;
    this.suggested_category = suggested_category;
    this.confidence = confidence;
    this.explanation = explanation;
    this.created_at = created_at;
  }

  // Create an AISuggestion instance from a database row
  static fromRow(row) {
    return new AISuggestion(
      row.id,
      row.bill_id,
      row.suggested_category,
      row.confidence,
      row.explanation,
      row.created_at
    );
  }

  // Convert AISuggestion instance to JSON
  toJSON() {
    return {
      id: this.id,
      bill_id: this.bill_id,
      suggested_category: this.suggested_category,
      confidence: this.confidence,
      explanation: this.explanation,
      created_at: this.created_at
    };
  }
}

module.exports = AISuggestion;